- /* slmststr.cpp by K.Tsuru */
- // function ID = 201
- /***************************
- SLong class
- Set a value by string *s.
- ****************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- void SLong::SetString(const char *s){
- StringToNumber temp(s);
- //check overflow & underflow
- if(temp.Type() & DEC_INT){ // integral type
- SNumber::CopyValue(temp, SUBS); //direct copy
- } else {
- //floating point type
- //temp = 0.aaaa bbbb cccc.... *R^p ===> aaaa bbbb cccc. *R^0
- int p = temp.RdxExp();
- if( p >= (int)MaxSize() ){
- SetError(OVERFLOW_ERR,"SL SetString", 201); return;
- } else if(p <= 0){
- //The absolute value is smaller than one.
- SetZero(); return;
- }
- uint q = (uint)p, j, last = min(q, temp.Head());
- valloc(q , 0);
- for(j = 1; j <= last; j++) figure[p-j] = temp[j];
- SetSign(temp.Sign());
- CheckArray(201);
- }
- }
slmststr.cpp : last modifiled at 2017/03/17 11:10:48(865 bytes)
created at 2017/10/07 10:26:49
The creation time of this html file is 2017/11/09 14:52:03 (Thu Nov 09 14:52:03 2017).